﻿
@{
    Layout = null;
    if (false)
    {
        <script src="~/LiberUI/Scripts/jquery.js"></script>
        <script src="~/Scripts/jquery.signalR-2.1.2.js"></script>
    }
}

<!DOCTYPE html>

<html>
<head>
    @System.Web.Optimization.Styles.Render("~/cssBase")
    @System.Web.Optimization.Scripts.Render("~/jsBase")
    <script src="~/Scripts/jquery.signalR-2.1.2.min.js"></script>
    <meta name="viewport" content="width=device-width" />
    <title>Console</title>
</head>
<body>
    <div id="screen">

    </div>
    <script>
        function onReceived(data) {
            $("#screen").append($("<span>").text(data));
        };

        $(function () {
            conn = $.connection("/SysMonitor");
            conn.received(onReceived);
            conn.start();
            console.log(conn);
            $(window).unload(null, function () {
                if (conn) {
                    conn.close();
                    conn = null;
                }
            });
        });
    </script>
</body>
</html>
